package com.xiaoge;

import com.xiaoge.circulardependency.A;
import com.xiaoge.service.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * TODO
 *
 * @author <a href="mailto:1330137071@qq.com">Zhang Xiao</a>
 * @since
 */
public class ZhangDepedencyInjection {
	public static void main(String[] args) {
		// 创建 ApplicationContext 容器
		AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class);

		//		ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring.xml");

//		UserService userService = (UserService) applicationContext.getBean("userService");
		A a = (A) applicationContext.getBean("a");
		System.out.println(a);
	}
}